// src/router/index.js
import { createRouter, createWebHistory } from 'vue-router';
import { h } from 'vue';

// import Home from '../views/Home.vue';
// import About from '../views/About.vue';

const routes = [
    {
        path: '/',
        component: () => import('@/views/center.vue')
    },
    {
        path: '/loginAdmin',
        name: 'loginAdmin',
        component: () => import('@/views/loginAdmin/login.vue')
    },
    {
        path: '/systemMana',
        name: 'systemMana',
        component: () => import('@/views/systemMana/index.vue'),
        redirect: '/systemMana/messageRecord',
        children: [
            {
                path: 'messageRecord',
                name: 'messageRecord',
                component: {
                    render () { return <router-view></router-view>; }
                },
                redirect: '/systemMana/messageRecord/5gesmessageDown',
                children: [
                    {
                        path: '5gesmessageDown',
                        name: '5gesmessageDown',
                        component: () => import('@/views/5gesmessageDown/index.vue')
                    }
                ]
            }
        ]
        // children: [
        //     {
        //         path: 'userMana',
        //         name: 'userMana',
        //         component: () => import('@/views/systemMana/userMana/index.vue')
        //     },
        //     {
        //         path: 'roleMana',
        //         name: 'roleMana',
        //         component: () => import('@/views/systemMana/roleMana/index.vue')
        //    },
        // ]
    }
];

routes.push({
    path: '/:pathMatch(.*)*',
    name: 'NotFound',
    component: () => import('@/views/404/index.vue')
});

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
});

export default router;